package com.woniuxy.education.mapper;

import com.woniuxy.education.entity.TeacherInformation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SelectTeacherDataMapper {
    //查询老师信息
    @Select("select name from user where account=#{account}")
    String selectTname(String account);
    @Select("select * from teacher where name=#{name}")
    TeacherInformation selectTinformation(String name);
//修改个人信息
    @Update("update teacher set tel=#{tel} where name=#{name}")
    void update(@Param("name") String name,@Param("tel") String tel);
//修改密码
    @Update("update user set password=#{newpassword} where account=#{name}")
    void updatePassword(
            @Param("name") String name,@Param("newpassword") String newpassword);

    //查询用户
    @Select("select password from user where account=#{name}")
    String selectAccount(String name);
}
